﻿<s:SurfaceWindow
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008"
    xmlns:metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns:me="clr-namespace:IPS.TabletDesk"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Custom="http://metro.mahapps.com/winfx/xaml/controls" MouseUp="SurfaceWindow_MouseUp" Closed="SurfaceWindow_Closed" x:Class="IPS.TabletDesk.MainWindow"
    Title="Tablet Desk" Width="1024" Height="640"
    WindowState="Normal"
    WindowStyle="None" Top="0"
    Left="0"
    ResizeMode="NoResize"
                 mc:Ignorable="d"
    Background="#FF1F1F1F" Icon="/NUILight.TabletDesk;component/icon1.ico">

    <s:SurfaceWindow.Resources>        
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Orange.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
				<ResourceDictionary Source="Resources/Icons.xaml" />
            </ResourceDictionary.MergedDictionaries>
			
            <Style TargetType="{x:Type s:SurfaceButton}" BasedOn="{StaticResource MetroButton}">
            	         <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
						 <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
			</Style>
        </ResourceDictionary>
    </s:SurfaceWindow.Resources>
        <Grid>
        <TabControl Name="tabs" SelectionChanged="tabs_SelectionChanged">
        	<TabItem Header="Venue View" TouchDown="TabItem_ContactDown">
        		<Grid Background="#FF161616">
        			<me:CueDisplay x:Name="cuedisplay" Margin="0,0,-8,0"/>
        			<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top">
        				<s:SurfaceButton Click="SurfaceButton_Click_1" HorizontalAlignment="Right" Margin="0,2,0,0" Height="48" Width="48" Padding="0,3,0,0" BorderThickness="1" Background="Transparent">
        					<Rectangle Width="32" Height="32">
            						<Rectangle.Fill> 
								<VisualBrush Visual="{StaticResource appbar_list1}" Stretch="None" />
							</Rectangle.Fill>
							</Rectangle>
							
        				</s:SurfaceButton>
        				<s:SurfaceButton Click="SurfaceButton_Click" HorizontalAlignment="Right" Margin="0,2,0,0" Height="48" Width="48" Padding="0" BorderThickness="1" Background="Transparent">
							<Rectangle Width="32" Height="32">
            						<Rectangle.Fill> 
								<VisualBrush Visual="{StaticResource appbar_equalizer}" Stretch="None" />
							</Rectangle.Fill>
							</Rectangle>
        				</s:SurfaceButton>
        				<s:SurfaceButton Click="SurfaceButton_Click_2" HorizontalAlignment="Right" Margin="0,2,0,0" Width="48" Height="48" Padding="0,5,0,7" BorderThickness="1" Background="Transparent"> 
							<Rectangle Width="32" Height="32">
            						<Rectangle.Fill> 
								<VisualBrush Visual="{StaticResource appbar_play}" Stretch="None" />
							</Rectangle.Fill>
							</Rectangle>
        				</s:SurfaceButton>
        				<s:SurfaceButton Click="SurfaceButton_Click_4" HorizontalAlignment="Right" Margin="0,2,0,0" Height="48" Width="48" Padding="0" BorderThickness="1" Background="Transparent">
        					<Rectangle Width="32" Height="32">
            						<Rectangle.Fill> 
								<VisualBrush Visual="{StaticResource appbar_crosshair}" Stretch="None" />
							</Rectangle.Fill>
							</Rectangle>
        				</s:SurfaceButton>
        			</StackPanel>
        			<s:ScatterView VerticalAlignment="Bottom" Height="584.527" Width="1014" HorizontalAlignment="Right" Margin="0" d:LayoutOverrides="Width">
        				<s:ScatterViewItem x:Name="playbackscatter" CanScale="False" Center="150,400" Orientation="0" Margin="0" CanRotate="False" >
        					<me:Playback x:Name="playback" Grid.Column="1" Grid.RowSpan="2" Margin="0"/>
        				</s:ScatterViewItem>
        			</s:ScatterView>
            		        	
        		</Grid>
        	</TabItem>
            <TabItem Header="Faders" TouchDown="TabItem_ContactDown">
        		<me:Faders x:Name="faders" d:LayoutOverrides="Width, Height, Margin" />
        	</TabItem>
        </TabControl>
            <Grid Opacity="0.3" PreviewTouchUp="cuelistscatter_PreviewContactUp" PreviewTouchDown="cuelistscatter_PreviewContactDown" x:Name="cuelistscatter" Width="218.167" Height="640" Background="#FF898989" HorizontalAlignment="Right" Margin="0">
            	<GroupBox Background="#FF232323" Header="Cues" Height="640" Foreground="White">
            		<Grid Margin="0">
            			<Grid.RowDefinitions>
            				<RowDefinition />
            				<RowDefinition Height="60" />
            			</Grid.RowDefinitions>

            			<s:SurfaceListBox ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" SelectionChanged="surfaceListBox1_SelectionChanged"  x:Name="surfaceListBox1" Margin="0,5,0,-18" VerticalContentAlignment="Top" Background="{DynamicResource LCD}" />
            			<UniformGrid Grid.Row="1" Rows="1" Columns="5" Margin="0,22,0,0">
            				<s:SurfaceButton x:Name="surfaceButton2" Click="surfaceButton2_Click" Padding="0" Margin="0,0,2,0" Background="Transparent">
            					<Rectangle Width="28"  Height="28">
            						<Rectangle.Fill> 
            							<VisualBrush Visual="{StaticResource appbar_page_new}" Stretch="Uniform" />				   						
            						</Rectangle.Fill>    					
            					</Rectangle>
            				</s:SurfaceButton>
							
            				<s:SurfaceButton  x:Name="surfaceButton3"  Click="surfaceButton3_Click" Padding="0" Margin="0,0,2,0" Background="Transparent">
            					
            					<Rectangle Width="28"  Height="28">
            						<Rectangle.Fill> 
            							<VisualBrush Visual="{StaticResource appbar_page_delete}" Stretch="Uniform" />				   						
            						</Rectangle.Fill>    					
            					</Rectangle>
            				</s:SurfaceButton>
            				<s:SurfaceButton   x:Name="surfaceButton4" Click="surfaceButton4_Click" Padding="0" Margin="0,0,2,0" Background="Transparent">
            					<Rectangle Width="28"  Height="28">
            						<Rectangle.Fill> 
            						<VisualBrush Visual="{StaticResource appbar_page_multiple}" Stretch="Uniform" />				   						
									</Rectangle.Fill>    					
								</Rectangle>
            				</s:SurfaceButton>
            				<s:SurfaceButton  x:Name="surfaceButton5"  Click="surfaceButton5_Click" Padding="0" Margin="0,0,2,0" Background="Transparent">
            					<Rectangle Width="28"  Height="28">
            						<Rectangle.Fill> 
            							<VisualBrush Visual="{StaticResource appbar_arrow_up}" Stretch="Uniform" />				   						
            						</Rectangle.Fill>    					
            					</Rectangle>
            				</s:SurfaceButton>
            				<s:SurfaceButton  x:Name="surfaceButton6"  Click="surfaceButton6_Click"  d:LayoutOverrides="VerticalAlignment" Padding="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="0,0,2,0" Background="Transparent">
            					<Rectangle Width="28"  Height="28">
            						<Rectangle.Fill> 
            							<VisualBrush Visual="{StaticResource appbar_arrow_down}" Stretch="Uniform" />				   						
            						</Rectangle.Fill>    					
            					</Rectangle>
            				</s:SurfaceButton>
            			</UniformGrid>
            		</Grid>
            	</GroupBox>
            </Grid>
            <Grid x:Name="setup" Grid.ColumnSpan="2" Grid.RowSpan="2" d:IsHidden="True">
            	<Grid.Background>
            		<ImageBrush ImageSource="rect3342.png"/>
            	</Grid.Background>
            <metro:ProgressRing x:Name="progress" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="20,0,0,20" Visibility="Hidden" IsActive="True" Foreground="Orange"/>
            <Label HorizontalContentAlignment="Center" Width="Auto" Margin="0,0,77.311,389" Content="Choose an available Server" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="18.667" FontFamily="/NUILight.SurfaceDesk;component/#Segoe"/>
            <s:SurfaceListBox Width="201" x:Name="servers" Background="{x:Null}" BorderBrush="{x:Null}" SelectionChanged="servers_SelectionChanged" Height="238.501" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,81,133.499" />
            <s:SurfaceTextBox Height="23" Margin="684,385,81,0" x:Name="address" VerticalAlignment="Top" Text="" Visibility="Hidden" />
            <s:SurfaceTextBox Height="23" Margin="439,488,432,0" x:Name="myname" VerticalAlignment="Top" Text="TabletDesk" Visibility="Hidden" />
            <s:SurfaceButton x:Name="surfaceButton10" HorizontalAlignment="Right" FontSize="25" Click="surfaceButton10_Click" Content="Start" VerticalAlignment="Bottom" Width="201.21" Margin="0,0,80.79,80.246" BorderBrush="#FF707070" HorizontalContentAlignment="Center" />
            <Label Height="28" Margin="680,359,156,0" x:Name="label5" VerticalAlignment="Top" HorizontalContentAlignment="Center" Content="Enter ThorDMX Server Address" Visibility="Hidden"/>
            <Label Height="28" Margin="439,458,432,0" VerticalAlignment="Top" HorizontalContentAlignment="Center" Content="Device Name" Visibility="Hidden" />
            	<Label HorizontalContentAlignment="Center" Width="Auto" Margin="0,161,77.311,0" Content="Tablet Lighting Desk" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="48" FontFamily="/NUILight.SurfaceDesk;component/#Segoe"/>
            	<metro:MetroProgressBar HorizontalAlignment="Right" Margin="0,0,80.79,382" Foreground="Orange" VerticalAlignment="Bottom" Width="157" IsIndeterminate="True" Height="10"/>
            	
        </Grid>
            <StackPanel x:Name="dirtyflag" Height="56" VerticalAlignment="Bottom" Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Hidden">
            	<Rectangle Width="50">
            		<Rectangle.Fill>
            			<VisualBrush Visual="{StaticResource appbar_warning}" Stretch="None" />
            		</Rectangle.Fill>
					</Rectangle>
            	<Label HorizontalContentAlignment="Center" Foreground="Red" Opacity="0.5" FontSize="28" IsHitTestVisible="False" Content="Cue Edited and Not Recorded Yet!" Margin="0,3.75"/>
            </StackPanel>
    </Grid>
</s:SurfaceWindow>